﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;

namespace LabyCLI.Commands
{
	class cmd_ren
    {
        Terminal frm = Terminal.Instance;

        public void Main(List<string> args)
        {
            if (File.Exists(args[0]))
            {
                File.Move(args[0], args[1]);
                Terminal.WriteLine("Renamed the file '" + args[0] + "'." + Environment.NewLine);
            }
            else
            {
                Terminal.WriteLine("Invaild file '" + args[1] + "'." + Environment.NewLine, Properties.Settings.Default.Terminal_ErrorForeColor);
            }
        }

        public void Main()
        {
            Terminal.WriteLine("Invaild amount of arguments." + Environment.NewLine, Properties.Settings.Default.Terminal_ErrorForeColor);
        }
    }
}
